home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19990725-20000114
/
000210_news@columbia.edu _Mon Oct 18 09:26:33 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
4KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id JAA28303
for <kermit.misc@watsun.cc.columbia.edu>; Mon, 18 Oct 1999 09:26:33 -0400 (EDT)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id JAA04174
for kermit.misc@watsun.cc.columbia.edu; Mon, 18 Oct 1999 09:18:35 -0400 (EDT)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: [Q] how to take an action on closing network connection OR redefine a command
Date: 18 Oct 1999 13:18:33 GMT
Organization: Columbia University
Message-ID: <7uf6n9$429$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <m2ln91jmj0.fsf@aleph.swift.xxx>,
Matt Swift <swift@alum.mit.edu> wrote:
: I want to use kermit to telnet to certain remote hosts via a local
: port forwarded by ssh ("tunnelling"). Suppose I want to telnet to my
: isp at shell.isp.com, and suppose I've defined `login' as a kermit
: macro which supplies user and password. This macro would bring up a
: normal, insecure connection:
:
: define isp -
: set host shell.isp.com,-
: login,-
: connect
:
: Now I want to redefine `isp' so that I can use it in the same way but
: it uses the tunelling method. Suppose I write a shell script `tunnel'
: that will establish the tunnel before exiting.
:
: define isp,-
: run tunnel start isp,-
: set host localhost:9000 /telnet,-
: login,-
: connect
:
As an aside, this would work very nicely in C-Kermit with:
pipe ssh <hostname>
except that the UNIX ssh client does not use standard i/o. Go figure.
(You can pipe rlogin, various telnet clients, cu, etc, but not ssh.)
(And of course we can't put ssh in Kermit itself due to licensing and
legal considerations.)
: This works just fine, except that the tunnel must be shut down
: manually. I would like to improve this macro so that the tunnel will
: be closed (by taken the action `run tunnel stop isp') automatically
: when kermit closes the connection. I do not see that there is any
: direct way to do this with kermit, so I thought of redefining
: the `close' command. Unfortunately it does not seem possible. I tried:
:
: assign close-orig close
: define close -
: echo a message,-
: close-orig
:
: After this, `close' from the kermit prompt executes the command
: `close' as usual. It does not execute the macro `close' that I just
: defined. If I do this:
:
: define my-close -
: echo a message,-
: close-orig
:
: typing `my-close' from the kermit prompt works as expected. But this
: is not elegant or convenient IMO.
:
You can't define a macro to supersede a built-in command. Imagine the
mischief you could cause if you could... If you really want to execeute
a macro whose name is the same as built-in command, use "do", as in
"define close ..." and then "do close".
: I would much appreciate any advice on how to arrange that kermit will
: take a definable action when a network connection is closed with
: `close' -- or, prefereably, when it is closed for whatever reason, but
: I though that this was a bit too ambitious to try to accomplish.
:
Something like this maybe? (C-Kermit 7.0):
define login <script login sequence>
define shut <commands for shutting down the tunnel>
define isp {
run tunnel start isp
set host localhost:9000 /telnet
if fail end 1 Can't make connection
login
if fail end 1 Login failure
while ( > \v(ttyfd) -1 ) {
connect
}
shut
}
Before 7.0 is released, we might also be able to add an ON_CLOSE macro
capability, similar to the current ON_EXIT macro.
- Frank